﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace RestApp.UI.Helpers
{
	public class PasswordHelper
	{
		public static string CreateRandomPassword(int length = 6)
		{
			const string ALLOWED_CHARS = "abcdefghijkmnopqrstuvwxyz0123456789"; // 'l' is skipped
			Random random = new Random((int)DateTime.Now.Ticks);
			char[] chars = new char[length];
			for (int i = 0; i < length; i++)
			{
				chars[i] = ALLOWED_CHARS[random.Next(ALLOWED_CHARS.Length)];
			}
			return new string(chars);
		}
	}
}